import { ADD, FUNC, LOGGER, MINUS, PROMISES, TIMEOUT } from '../action-types'

function tools(state = { count: 0 }, action) {
  switch (action.type) {
    case ADD:
      return { count: state.count + 1 }
    case MINUS:
      return { count: state.count - 1 }
    case LOGGER:
      return { count: state.count + 2 }
    case FUNC:
      return { count: state.count + 3 }
    case PROMISES:
      return { count: state.count + 4 }
    case TIMEOUT:
      return { count: state.count + 5 }
    default:
      return state
  }
}

export default tools
